package com.company;

import java.util.Scanner;

/**
 * @author jrue
 * @version 1.0
 * @date 2020/3/24 18:53
 */
public class Main71 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();

        if (s1 == null || s1.length() == 0) {
            System.out.println(0);
            return;
        }

        int difference = 0;
        int tNums01 = 0,tNums02 = 0;
        for (int i = 0; i < s1.length(); i++) {
            if (s1.charAt(i) != s2.charAt(i)) difference++;
            if (s1.charAt(i) == 'T') tNums01++;
            if (s2.charAt(i) == 'T') tNums02++;
        }
        if (tNums01 == tNums02) {
            System.out.println(difference);
            return;
        }

        int res = Math.abs(tNums01 - tNums02);
        res += (difference - res) / 2;

        System.out.println(res);


    }

}
